package push.tools.service.config.db;


import com.alibaba.druid.pool.DruidDataSource;
import push.tools.service.constant.ConfigMap;


/**
 * hm
 * 主数据源
 */
public class CustomDruidDataSource extends DruidDataSource {

    public CustomDruidDataSource() {
        String url = ConfigMap.ds1.get("url");
        String Username = ConfigMap.ds1.get("Username");
        String Password = ConfigMap.ds1.get("Password");
        String DriverClassName = ConfigMap.ds1.get("DriverClassName");
        setUrl(url);
        setUsername(Username);
        setPassword(Password);
        setDriverClassName(DriverClassName);
        //初始化配置
        setInitialSize(5);
        setMaxActive(200);
        setMinIdle(10);
        setFailFast(true);
    }
}
